package cn.ssm.controller;

import cn.ssm.doman.User;
import cn.ssm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class UserController {
    @Autowired
    private UserService userService;
    public ModelAndView login(User user) {
        ModelAndView modelAndView = new ModelAndView();
        userService.login(user);
        /*将查询到的数据存储到model中*/
        modelAndView.addObject(user);
        modelAndView.setViewName("frame");
        return modelAndView;
    }
}
